<?php
namespace Home\Controller;
use Org\Util\Arr;

class IndexController extends BaseContoller {
    public function index(){
        $headConf = ['title'=>'维依尚品_首页','js'=>['index']];
        $this->assign('headConf',$headConf);
        //处理二级菜单
        $field = (new Arr())->channelLevel(m('Category')->select(), $pid = 0, $html = "&nbsp;", $fieldPri = 'cid',
            $fieldPid = 'pid', $level = 1);

        $fengyigoods = m ('goods')->alias ('g')->join ('__DETAIL__ d on g.gid=d.gid')->where('g.tid=4')->select();//风衣
        $lianyiqungoods = m ('goods')->alias ('g')->join ('__DETAIL__ d on g.gid=d.gid')->where('g.tid=9')->select();//连衣裙
        $weiyigoods = m ('goods')->alias ('g')->join ('__DETAIL__ d on g.gid=d.gid')->where('g.tid=2')->select();//卫衣
        $chenshangoods = m ('goods')->alias ('g')->join ('__DETAIL__ d on g.gid=d.gid')->where('g.tid=6')->select();//衬衫
        $DaDiKgoods = m ('goods')->alias ('g')->join ('__DETAIL__ d on g.gid=d.gid')->where('g.tid=31')->select();//休闲裤
        $Xinpingoods = m ('goods')->alias ('g')->join ('__DETAIL__ d on g.gid=d.gid')->where('g.tid=27')->select();//新品速递|新上新

        $this->assign('field',$field);
        $this->assign('fengyigoods',$fengyigoods);
        $this->assign('lianyiqungoods',$lianyiqungoods);
        $this->assign('weiyigoods',$weiyigoods);
        $this->assign('Xinpingoods',$Xinpingoods);
        $this->assign('chenshangoods',$chenshangoods);
        $this->assign('DaDiKgoods',$DaDiKgoods);
//        $yijigoods = m ('type')->select();
//        dd($yijigoods);
        $this->display();
    }
}